<?php
$uin=empty($_GET['uin'])?exit('Error!'):$_GET['uin'];

function checkvc($uin)
{
	$cookie_array=array();
	$ch=curl_init('http://check.ptlogin2.qzone.com/check?pt_tea=1&uin='.$uin.'&appid=549000929&ptlang=2052&r=0.9947'.time());
	curl_setopt($ch, CURLOPT_HEADER, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0');
    //curl_setopt($ch, CURLOPT_REFERER, "");
    $data = curl_exec($ch);
    curl_close($ch);
	if(preg_match_all('/Set-Cookie:(.*);/iU', $data, $cookie)){//有cookies返回
		foreach($cookie[1] as $value){
			$tmp=explode("=",$val);
			$cookie_array[$tmp[0]]=$tmp[1];
		}
	}
	//print_r($data);exit;
    if(preg_match("/ptui_checkVC\('(.*?)'\);/", $data, $arr)){
		$r=explode("','",$arr[1]);
		if(strlen($r[1])>4){
			return '1,'.$uin.','.$r[2];
		}else{
			return $r[0].','.$uin.','.$r[1].','.$r[2].','.$r[3];
		}
	}else{
		return false;
	}
}
echo checkvc($uin);
?>